package com.example.service.impl;

import com.example.domain.SysMeetingroom;
import com.example.mapper.SysMeetingroomMapper;
import com.example.service.ISysMeetingroomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会议室信息Service业务层处理
 * 
 * @author ruoyi
 */
@Service
public class SysMeetingroomServiceImpl implements ISysMeetingroomService
{
    @Autowired
    private SysMeetingroomMapper sysMeetingroomMapper;

    /**
     * 查询会议室信息
     * 
     * @param id 会议室信息主键
     * @return 会议室信息
     */
    @Override
    public SysMeetingroom selectSysMeetingroomById(Long id)
    {
        return sysMeetingroomMapper.selectSysMeetingroomById(id);
    }

    /**
     * 查询会议室信息列表
     * 
     * @param sysMeetingroom 会议室信息
     * @return 会议室信息
     */
    @Override
    public List<SysMeetingroom> selectSysMeetingroomList(SysMeetingroom sysMeetingroom)
    {
        return sysMeetingroomMapper.selectSysMeetingroomList(sysMeetingroom);
    }

    /**
     * 新增会议室信息
     * 
     * @param sysMeetingroom 会议室信息
     * @return 结果
     */
    @Override
    public int insertSysMeetingroom(SysMeetingroom sysMeetingroom)
    {
        return sysMeetingroomMapper.insertSysMeetingroom(sysMeetingroom);
    }

    /**
     * 修改会议室信息
     * 
     * @param sysMeetingroom 会议室信息
     * @return 结果
     */
    @Override
    public int updateSysMeetingroom(SysMeetingroom sysMeetingroom)
    {
        return sysMeetingroomMapper.updateSysMeetingroom(sysMeetingroom);
    }

    /**
     * 批量删除会议室信息
     * 
     * @param ids 需要删除的会议室信息主键
     * @return 结果
     */
    @Override
    public int deleteSysMeetingroomByIds(Long[] ids)
    {
        return sysMeetingroomMapper.deleteSysMeetingroomByIds(ids);
    }

    /**
     * 删除会议室信息信息
     * 
     * @param id 会议室信息主键
     * @return 结果
     */
    @Override
    public int deleteSysMeetingroomById(Long id)
    {
        return sysMeetingroomMapper.deleteSysMeetingroomById(id);
    }

    @Override
    public int updateStatusById(Long id, Integer status) {
        SysMeetingroom meetingroom = new SysMeetingroom();
        meetingroom.setId( id );
        meetingroom.setStatus( status );
        return sysMeetingroomMapper.updateSysMeetingroom(meetingroom);
    }
}
